package com.xjscrm.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xjscrm.common.entity.WwGroup;
import com.xjscrm.console.chat.frame.recv.RPullGroupMsg;
import com.xjscrm.console.param.group.WwGroupQuery;
import com.xjscrm.console.vo.WwGroupVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WwGroupMapper {
    List<WwGroupVo> getWwGroupList(WwGroupQuery wwGroupQuery);

    WwGroup getById(@Param("id") Long id, @Param("merId") Long merId);

    int updateWwGroup(WwGroup wwGroup);

    int deleById(@Param("id") Long id, @Param("merId") Long merId);

    List<WwGroup> pageByDeviceUniqueId(Page<WwGroup> page, @Param("merId") Long merId,
                                       @Param("deviceUniqueId") Long deviceUniqueId);

    List<WwGroup> pageByCondition(Page<WwGroup> page, @Param("param") RPullGroupMsg group);

    WwGroup selectByGroupWxId(@Param("merId") Long merId, @Param("deviceUniqueId") Long deviceUniqueId, @Param("groupWxId") String conversationId);

    WwGroup getByGroupWxid(@Param("groupWxid") String groupWxid, @Param("deviceId") String deviceId, @Param("merId") Long merId);


    WwGroup selectByGroupWxIdAndDeviceId(@Param("merId") Long merId, @Param("deviceId") String deviceId, @Param("groupWxId") String conversationId);
}
